#!/bin/sh

if test "$1" -eq 256 ; then
  e=$((128 + $2))
else
  e="$1"
fi

echo "ttyd service exited with code $1 (by signal $2)."

echo "$e" > /run/s6-linux-init-container-results/exitcode
